/**
 * $
 */

package com.swehr.model;

import com.swehr.common.DateUtil;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;

/**
 * @author Rock Huang
 * @version 0.1
 */
@XmlRootElement
public class Personnel {
    private int id;
    private String name;
    private String email;
    private String gender;
    private String phoneNumber;
    private Date birthday;
    private String orgUri;
    private String posUri;
    private String type;
    private String comment;

    public Personnel() {}

    public int getId() {
        return id;
    }

    public void setId(int psnId) {
        this.id = psnId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getOrgUri() {
        return orgUri;
    }

    public void setOrgUri(String orgUri) {
        this.orgUri = orgUri;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getPosUri() {
        return posUri;
    }

    public void setPosUri(String posUri) {
        this.posUri = posUri;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer();
        sb.append("{ \"id\":\"").append(id).append("\"");
        sb.append(", \"type:\"").append(type).append("\"");
        sb.append(", \"orgUri:\"").append(orgUri).append("\"");
        sb.append(", \"posUri:\"").append(posUri).append("\"");
        sb.append(", \"name:\"").append(name).append("\"");
        sb.append(", \"email:\"").append(email).append("\"");
        sb.append(", \"gender:\"").append(gender).append("\"");
        sb.append(", \"phoneNumber:\"").append(phoneNumber).append("\"");
        sb.append(", \"birthday:\"").append(DateUtil.f(birthday));
        sb.append(", \"comment:\"").append(comment);
        sb.append("\"}");
        return sb.toString();
    }
}
